package org.hackystat.devcathlon.ui.page.matches.manage.matchdeletepanel;

import org.apache.wicket.behavior.SimpleAttributeModifier;
import org.apache.wicket.markup.ComponentTag;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.hackystat.devcathlon.engine.match.Match;
import org.hackystat.devcathlon.ui.page.DevcathlonBasePage;

/**
 * Delete a match page, uses MatchDeletePanel.
 * @author robin
 *
 */
public class MatchDeletePage extends DevcathlonBasePage {
  /** Support serialization. */
  private static final long serialVersionUID = 1L;

  /**
   * Creates the match delete page. 
   * @param mItem The match instance.
   */
  public MatchDeletePage(Match mItem) {
    // Set the body class attribute to section-3 so that the menubar is correct.
    add(new WebMarkupContainer("body") { 
      private static final long serialVersionUID = 1L;
      @Override
      public boolean isTransparentResolver() { 
        return true; 
        } 
      @Override
      protected void onComponentTag(ComponentTag tag) { 
        tag.put("class","section-3"); 
        }
    }
    ); 
    
    // Add matches panel.
    //add(new MatchPanel("matchpanel", session.getListItem()));
    add(new MatchDeletePanel("matchdeletepanel", mItem));
    
    
    // Make the tab corresponding to this page bold.
    get("MatchesManageLink").add(new SimpleAttributeModifier("class", "selected"));
  }
}
